import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '日期',
    align:"center",
    dataIndex: 'date'
   },
   {
    title: '门店名称',
    align:"center",
    dataIndex: 'storeName'
   },
   {
    title: '门店id',
    align:"center",
    dataIndex: 'storeId'
   },
   {
    title: '省份',
    align:"center",
    dataIndex: 'province'
   },
   {
    title: '门店所在城市',
    align:"center",
    dataIndex: 'city'
   },
   {
    title: '区县市',
    align:"center",
    dataIndex: 'county'
   },
   {
    title: '收入',
    align:"center",
    dataIndex: 'income'
   },
   {
    title: '商品原价',
    align:"center",
    dataIndex: 'originalPrice'
   },
   {
    title: '包装费',
    align:"center",
    dataIndex: 'pkgFee'
   },
   {
    title: '顾客配送费（跑腿/自配送）',
    align:"center",
    dataIndex: 'deliverFee'
   },
   {
    title: '支出',
    align:"center",
    dataIndex: 'expend'
   },
   {
    title: '商家活动支出',
    align:"center",
    dataIndex: 'storePreferentialExpend'
   },
   {
    title: '公益捐款',
    align:"center",
    dataIndex: 'donate'
   },
   {
    title: '其它支出',
    align:"center",
    dataIndex: 'otherExpend'
   },
   {
    title: '营业额',
    align:"center",
    dataIndex: 'turnover'
   },
   {
    title: '顾客实付',
    align:"center",
    dataIndex: 'actualPay'
   },
   {
    title: '有效订单',
    align:"center",
    dataIndex: 'effectiveOrder'
   },
   {
    title: '实付单均价',
    align:"center",
    dataIndex: 'actualPayAvg'
   },
   {
    title: '活动补贴',
    align:"center",
    dataIndex: 'subsity'
   },
   {
    title: '平台活动补贴',
    align:"center",
    dataIndex: 'subsityPlatfrom'
   },
   {
    title: '平台服务费(含佣金和配送服务费)',
    align:"center",
    dataIndex: 'platformServiceFee'
   },
   {
    title: '顾客实付（不含券）',
    align:"center",
    dataIndex: 'actualPayNoDiscount'
   },
   {
    title: '实付单均价（不含券）',
    align:"center",
    dataIndex: 'actualPayAvgNoDiscount'
   },
   {
    title: '曝光人数',
    align:"center",
    dataIndex: 'exposeCustomer'
   },
   {
    title: '入店人数',
    align:"center",
    dataIndex: 'visitCustomerNumber'
   },
   {
    title: '入店转化率',
    align:"center",
    dataIndex: 'visitRate'
   },
   {
    title: '下单转化率',
    align:"center",
    dataIndex: 'buyRate'
   },
   {
    title: '曝光新客',
    align:"center",
    dataIndex: 'exposeCustomerNew'
   },
   {
    title: '入店新客',
    align:"center",
    dataIndex: 'visitCustomerNew'
   },
   {
    title: '新客入店转化率',
    align:"center",
    dataIndex: 'visitRateNewCustomer'
   },
   {
    title: '新客下单转化率',
    align:"center",
    dataIndex: 'buyRateNewCustomer'
   },
   {
    title: '曝光老客',
    align:"center",
    dataIndex: 'exposeCustomerOld'
   },
   {
    title: '入店老客',
    align:"center",
    dataIndex: 'visitCustomerOld'
   },
   {
    title: '老客入店转化率',
    align:"center",
    dataIndex: 'visitRateOldCustomer'
   },
   {
    title: '老客下单转化率',
    align:"center",
    dataIndex: 'buyRateOldCustomer'
   },
   {
    title: '曝光次数',
    align:"center",
    dataIndex: 'exposeNumber'
   },
   {
    title: '入店次数',
    align:"center",
    dataIndex: 'visitNumber'
   },
   {
    title: '当日流量类型',
    align:"center",
    dataIndex: 'streamTypeToday'
   },
   {
    title: '7日流量类型',
    align:"center",
    dataIndex: 'streamType7d'
   },
   {
    title: '30日流量类型',
    align:"center",
    dataIndex: 'streamType30d'
   },
   {
    title: '下单人数',
    align:"center",
    dataIndex: 'buyNumber'
   },
   {
    title: '下单新客',
    align:"center",
    dataIndex: 'buyNewCustomer'
   },
   {
    title: '下单老客',
    align:"center",
    dataIndex: 'buyOldCustomer'
   },
   {
    title: '取消订单',
    align:"center",
    dataIndex: 'cancelOrderNumber'
   },
   {
    title: '商责取消订单',
    align:"center",
    dataIndex: 'cancelOrderStoreNumber'
   },
   {
    title: '商责取消率',
    align:"center",
    dataIndex: 'cancelOrderStoreRate'
   },
   {
    title: '店铺分',
    align:"center",
    dataIndex: 'store'
   },
   {
    title: '高峰营业时长得分',
    align:"center",
    dataIndex: 'storeRushHour'
   },
   {
    title: '优质商品率得分',
    align:"center",
    dataIndex: 'storeGoodsRate'
   },
   {
    title: '有效活动丰富度得分',
    align:"center",
    dataIndex: 'storeSubsityRate'
   },
   {
    title: '商家不接单率得分',
    align:"center",
    dataIndex: 'storeRefuseOrderRate'
   },
   {
    title: '差评回复率得分',
    align:"center",
    dataIndex: 'storeAnswerBadMsgRate'
   },
   {
    title: '在线联系回复率得分',
    align:"center",
    dataIndex: 'storeAnserOnlineRate'
   },
   {
    title: '商家评分得分',
    align:"center",
    dataIndex: 'storeStoreStore'
   },
   {
    title: '近30日日均高峰营业时长',
    align:"center",
    dataIndex: 'rushHour30d'
   },
   {
    title: '优质商品率',
    align:"center",
    dataIndex: 'rateGoods'
   },
   {
    title: '有效活动丰富度',
    align:"center",
    dataIndex: 'effectiveSubsityNumberRate'
   },
   {
    title: '近30日商家不接单率',
    align:"center",
    dataIndex: 'rateRefuseOrder30d'
   },
   {
    title: '近30日差评回复率',
    align:"center",
    dataIndex: 'rateAnswserBadMsg30d'
   },
   {
    title: '近7日日均在线联系回复率',
    align:"center",
    dataIndex: 'rateOnlineAnwserAvg'
   },
   {
    title: '商家评分',
    align:"center",
    dataIndex: 'storeStore'
   },
   {
    title: '菜单丰富度得分',
    align:"center",
    dataIndex: 'storeMenu'
   },
   {
    title: '装修丰富度得分',
    align:"center",
    dataIndex: 'storeRenovate'
   },
   {
    title: '服务功能丰富度得分',
    align:"center",
    dataIndex: 'storeService'
   },
   {
    title: '菜单丰富度',
    align:"center",
    dataIndex: 'menuNumber'
   },
   {
    title: '装修丰富度',
    align:"center",
    dataIndex: 'renoveteNumber'
   },
   {
    title: '服务功能丰富度',
    align:"center",
    dataIndex: 'serviceNumber'
   },
   {
    title: '出餐完成上报率/配送准时率',
    align:"center",
    dataIndex: 'rateOntime'
   },
   {
    title: '基础营业时长得分',
    align:"center",
    dataIndex: 'storeBasicServiceTime'
   },
   {
    title: '基础营业时长',
    align:"center",
    dataIndex: 'basicServiceTime'
   },
   {
    title: '出餐完成上报率得分/配送准时率得分',
    align:"center",
    dataIndex: 'storeOntime'
   },
   {
    title: '配送信息上传率',
    align:"center",
    dataIndex: 'rateUploadDeliverInfo'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "日期",
      field: 'date',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "门店名称",
      field: 'storeName',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "门店id",
      field: 'storeId',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "省份",
      field: 'province',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "门店所在城市",
      field: 'city',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "区县市",
      field: 'county',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '日期',
    field: 'date',
    component: 'Input',
  },
  {
    label: '门店名称',
    field: 'storeName',
    component: 'Input',
  },
  {
    label: '门店id',
    field: 'storeId',
    component: 'Input',
  },
  {
    label: '省份',
    field: 'province',
    component: 'Input',
  },
  {
    label: '门店所在城市',
    field: 'city',
    component: 'Input',
  },
  {
    label: '区县市',
    field: 'county',
    component: 'Input',
  },
  {
    label: '收入',
    field: 'income',
    component: 'InputNumber',
  },
  {
    label: '商品原价',
    field: 'originalPrice',
    component: 'InputNumber',
  },
  {
    label: '包装费',
    field: 'pkgFee',
    component: 'InputNumber',
  },
  {
    label: '顾客配送费（跑腿/自配送）',
    field: 'deliverFee',
    component: 'InputNumber',
  },
  {
    label: '支出',
    field: 'expend',
    component: 'InputNumber',
  },
  {
    label: '商家活动支出',
    field: 'storePreferentialExpend',
    component: 'InputNumber',
  },
  {
    label: '公益捐款',
    field: 'donate',
    component: 'InputNumber',
  },
  {
    label: '其它支出',
    field: 'otherExpend',
    component: 'InputNumber',
  },
  {
    label: '营业额',
    field: 'turnover',
    component: 'InputNumber',
  },
  {
    label: '顾客实付',
    field: 'actualPay',
    component: 'InputNumber',
  },
  {
    label: '有效订单',
    field: 'effectiveOrder',
    component: 'InputNumber',
  },
  {
    label: '实付单均价',
    field: 'actualPayAvg',
    component: 'InputNumber',
  },
  {
    label: '活动补贴',
    field: 'subsity',
    component: 'InputNumber',
  },
  {
    label: '平台活动补贴',
    field: 'subsityPlatfrom',
    component: 'InputNumber',
  },
  {
    label: '平台服务费(含佣金和配送服务费)',
    field: 'platformServiceFee',
    component: 'InputNumber',
  },
  {
    label: '顾客实付（不含券）',
    field: 'actualPayNoDiscount',
    component: 'InputNumber',
  },
  {
    label: '实付单均价（不含券）',
    field: 'actualPayAvgNoDiscount',
    component: 'InputNumber',
  },
  {
    label: '曝光人数',
    field: 'exposeCustomer',
    component: 'InputNumber',
  },
  {
    label: '入店人数',
    field: 'visitCustomerNumber',
    component: 'InputNumber',
  },
  {
    label: '入店转化率',
    field: 'visitRate',
    component: 'InputNumber',
  },
  {
    label: '下单转化率',
    field: 'buyRate',
    component: 'InputNumber',
  },
  {
    label: '曝光新客',
    field: 'exposeCustomerNew',
    component: 'InputNumber',
  },
  {
    label: '入店新客',
    field: 'visitCustomerNew',
    component: 'InputNumber',
  },
  {
    label: '新客入店转化率',
    field: 'visitRateNewCustomer',
    component: 'InputNumber',
  },
  {
    label: '新客下单转化率',
    field: 'buyRateNewCustomer',
    component: 'InputNumber',
  },
  {
    label: '曝光老客',
    field: 'exposeCustomerOld',
    component: 'InputNumber',
  },
  {
    label: '入店老客',
    field: 'visitCustomerOld',
    component: 'InputNumber',
  },
  {
    label: '老客入店转化率',
    field: 'visitRateOldCustomer',
    component: 'InputNumber',
  },
  {
    label: '老客下单转化率',
    field: 'buyRateOldCustomer',
    component: 'InputNumber',
  },
  {
    label: '曝光次数',
    field: 'exposeNumber',
    component: 'InputNumber',
  },
  {
    label: '入店次数',
    field: 'visitNumber',
    component: 'InputNumber',
  },
  {
    label: '当日流量类型',
    field: 'streamTypeToday',
    component: 'Input',
  },
  {
    label: '7日流量类型',
    field: 'streamType7d',
    component: 'Input',
  },
  {
    label: '30日流量类型',
    field: 'streamType30d',
    component: 'Input',
  },
  {
    label: '下单人数',
    field: 'buyNumber',
    component: 'InputNumber',
  },
  {
    label: '下单新客',
    field: 'buyNewCustomer',
    component: 'InputNumber',
  },
  {
    label: '下单老客',
    field: 'buyOldCustomer',
    component: 'InputNumber',
  },
  {
    label: '取消订单',
    field: 'cancelOrderNumber',
    component: 'InputNumber',
  },
  {
    label: '商责取消订单',
    field: 'cancelOrderStoreNumber',
    component: 'InputNumber',
  },
  {
    label: '商责取消率',
    field: 'cancelOrderStoreRate',
    component: 'InputNumber',
  },
  {
    label: '店铺分',
    field: 'store',
    component: 'InputNumber',
  },
  {
    label: '高峰营业时长得分',
    field: 'storeRushHour',
    component: 'InputNumber',
  },
  {
    label: '优质商品率得分',
    field: 'storeGoodsRate',
    component: 'InputNumber',
  },
  {
    label: '有效活动丰富度得分',
    field: 'storeSubsityRate',
    component: 'InputNumber',
  },
  {
    label: '商家不接单率得分',
    field: 'storeRefuseOrderRate',
    component: 'InputNumber',
  },
  {
    label: '差评回复率得分',
    field: 'storeAnswerBadMsgRate',
    component: 'InputNumber',
  },
  {
    label: '在线联系回复率得分',
    field: 'storeAnserOnlineRate',
    component: 'InputNumber',
  },
  {
    label: '商家评分得分',
    field: 'storeStoreStore',
    component: 'InputNumber',
  },
  {
    label: '近30日日均高峰营业时长',
    field: 'rushHour30d',
    component: 'InputNumber',
  },
  {
    label: '优质商品率',
    field: 'rateGoods',
    component: 'InputNumber',
  },
  {
    label: '有效活动丰富度',
    field: 'effectiveSubsityNumberRate',
    component: 'Input',
  },
  {
    label: '近30日商家不接单率',
    field: 'rateRefuseOrder30d',
    component: 'Input',
  },
  {
    label: '近30日差评回复率',
    field: 'rateAnswserBadMsg30d',
    component: 'Input',
  },
  {
    label: '近7日日均在线联系回复率',
    field: 'rateOnlineAnwserAvg',
    component: 'Input',
  },
  {
    label: '商家评分',
    field: 'storeStore',
    component: 'InputNumber',
  },
  {
    label: '菜单丰富度得分',
    field: 'storeMenu',
    component: 'Input',
  },
  {
    label: '装修丰富度得分',
    field: 'storeRenovate',
    component: 'InputNumber',
  },
  {
    label: '服务功能丰富度得分',
    field: 'storeService',
    component: 'Input',
  },
  {
    label: '菜单丰富度',
    field: 'menuNumber',
    component: 'Input',
  },
  {
    label: '装修丰富度',
    field: 'renoveteNumber',
    component: 'Input',
  },
  {
    label: '服务功能丰富度',
    field: 'serviceNumber',
    component: 'Input',
  },
  {
    label: '出餐完成上报率/配送准时率',
    field: 'rateOntime',
    component: 'Input',
  },
  {
    label: '基础营业时长得分',
    field: 'storeBasicServiceTime',
    component: 'InputNumber',
  },
  {
    label: '基础营业时长',
    field: 'basicServiceTime',
    component: 'InputNumber',
  },
  {
    label: '出餐完成上报率得分/配送准时率得分',
    field: 'storeOntime',
    component: 'InputNumber',
  },
  {
    label: '配送信息上传率',
    field: 'rateUploadDeliverInfo',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  date: {title: '日期',order: 0,view: 'text', type: 'string',},
  storeName: {title: '门店名称',order: 1,view: 'text', type: 'string',},
  storeId: {title: '门店id',order: 2,view: 'text', type: 'string',},
  province: {title: '省份',order: 3,view: 'text', type: 'string',},
  city: {title: '门店所在城市',order: 4,view: 'text', type: 'string',},
  county: {title: '区县市',order: 5,view: 'text', type: 'string',},
  income: {title: '收入',order: 6,view: 'number', type: 'number',},
  originalPrice: {title: '商品原价',order: 7,view: 'number', type: 'number',},
  pkgFee: {title: '包装费',order: 8,view: 'number', type: 'number',},
  deliverFee: {title: '顾客配送费（跑腿/自配送）',order: 9,view: 'number', type: 'number',},
  expend: {title: '支出',order: 10,view: 'number', type: 'number',},
  storePreferentialExpend: {title: '商家活动支出',order: 11,view: 'number', type: 'number',},
  donate: {title: '公益捐款',order: 12,view: 'number', type: 'number',},
  otherExpend: {title: '其它支出',order: 13,view: 'number', type: 'number',},
  turnover: {title: '营业额',order: 14,view: 'number', type: 'number',},
  actualPay: {title: '顾客实付',order: 15,view: 'number', type: 'number',},
  effectiveOrder: {title: '有效订单',order: 16,view: 'number', type: 'number',},
  actualPayAvg: {title: '实付单均价',order: 17,view: 'number', type: 'number',},
  subsity: {title: '活动补贴',order: 18,view: 'number', type: 'number',},
  subsityPlatfrom: {title: '平台活动补贴',order: 19,view: 'number', type: 'number',},
  platformServiceFee: {title: '平台服务费(含佣金和配送服务费)',order: 20,view: 'number', type: 'number',},
  actualPayNoDiscount: {title: '顾客实付（不含券）',order: 21,view: 'number', type: 'number',},
  actualPayAvgNoDiscount: {title: '实付单均价（不含券）',order: 22,view: 'number', type: 'number',},
  exposeCustomer: {title: '曝光人数',order: 23,view: 'number', type: 'number',},
  visitCustomerNumber: {title: '入店人数',order: 24,view: 'number', type: 'number',},
  visitRate: {title: '入店转化率',order: 25,view: 'number', type: 'number',},
  buyRate: {title: '下单转化率',order: 26,view: 'number', type: 'number',},
  exposeCustomerNew: {title: '曝光新客',order: 27,view: 'number', type: 'number',},
  visitCustomerNew: {title: '入店新客',order: 28,view: 'number', type: 'number',},
  visitRateNewCustomer: {title: '新客入店转化率',order: 29,view: 'number', type: 'number',},
  buyRateNewCustomer: {title: '新客下单转化率',order: 30,view: 'number', type: 'number',},
  exposeCustomerOld: {title: '曝光老客',order: 31,view: 'number', type: 'number',},
  visitCustomerOld: {title: '入店老客',order: 32,view: 'number', type: 'number',},
  visitRateOldCustomer: {title: '老客入店转化率',order: 33,view: 'number', type: 'number',},
  buyRateOldCustomer: {title: '老客下单转化率',order: 34,view: 'number', type: 'number',},
  exposeNumber: {title: '曝光次数',order: 35,view: 'number', type: 'number',},
  visitNumber: {title: '入店次数',order: 36,view: 'number', type: 'number',},
  streamTypeToday: {title: '当日流量类型',order: 37,view: 'text', type: 'string',},
  streamType7d: {title: '7日流量类型',order: 38,view: 'text', type: 'string',},
  streamType30d: {title: '30日流量类型',order: 39,view: 'text', type: 'string',},
  buyNumber: {title: '下单人数',order: 40,view: 'number', type: 'number',},
  buyNewCustomer: {title: '下单新客',order: 41,view: 'number', type: 'number',},
  buyOldCustomer: {title: '下单老客',order: 42,view: 'number', type: 'number',},
  cancelOrderNumber: {title: '取消订单',order: 43,view: 'number', type: 'number',},
  cancelOrderStoreNumber: {title: '商责取消订单',order: 44,view: 'number', type: 'number',},
  cancelOrderStoreRate: {title: '商责取消率',order: 45,view: 'number', type: 'number',},
  store: {title: '店铺分',order: 46,view: 'number', type: 'number',},
  storeRushHour: {title: '高峰营业时长得分',order: 47,view: 'number', type: 'number',},
  storeGoodsRate: {title: '优质商品率得分',order: 48,view: 'number', type: 'number',},
  storeSubsityRate: {title: '有效活动丰富度得分',order: 49,view: 'number', type: 'number',},
  storeRefuseOrderRate: {title: '商家不接单率得分',order: 50,view: 'number', type: 'number',},
  storeAnswerBadMsgRate: {title: '差评回复率得分',order: 51,view: 'number', type: 'number',},
  storeAnserOnlineRate: {title: '在线联系回复率得分',order: 52,view: 'number', type: 'number',},
  storeStoreStore: {title: '商家评分得分',order: 53,view: 'number', type: 'number',},
  rushHour30d: {title: '近30日日均高峰营业时长',order: 54,view: 'number', type: 'number',},
  rateGoods: {title: '优质商品率',order: 55,view: 'number', type: 'number',},
  effectiveSubsityNumberRate: {title: '有效活动丰富度',order: 56,view: 'text', type: 'string',},
  rateRefuseOrder30d: {title: '近30日商家不接单率',order: 57,view: 'text', type: 'string',},
  rateAnswserBadMsg30d: {title: '近30日差评回复率',order: 58,view: 'text', type: 'string',},
  rateOnlineAnwserAvg: {title: '近7日日均在线联系回复率',order: 59,view: 'text', type: 'string',},
  storeStore: {title: '商家评分',order: 60,view: 'number', type: 'number',},
  storeMenu: {title: '菜单丰富度得分',order: 61,view: 'text', type: 'string',},
  storeRenovate: {title: '装修丰富度得分',order: 62,view: 'number', type: 'number',},
  storeService: {title: '服务功能丰富度得分',order: 63,view: 'text', type: 'string',},
  menuNumber: {title: '菜单丰富度',order: 64,view: 'text', type: 'string',},
  renoveteNumber: {title: '装修丰富度',order: 65,view: 'text', type: 'string',},
  serviceNumber: {title: '服务功能丰富度',order: 66,view: 'text', type: 'string',},
  rateOntime: {title: '出餐完成上报率/配送准时率',order: 67,view: 'text', type: 'string',},
  storeBasicServiceTime: {title: '基础营业时长得分',order: 68,view: 'number', type: 'number',},
  basicServiceTime: {title: '基础营业时长',order: 69,view: 'number', type: 'number',},
  storeOntime: {title: '出餐完成上报率得分/配送准时率得分',order: 70,view: 'number', type: 'number',},
  rateUploadDeliverInfo: {title: '配送信息上传率',order: 71,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}